<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>设置用户</title>
	<include file="Public:header" />
	<style type="text/css">
		/*input,textarea{width:180px;border:1px solid #ccc;padding:2px;}*/
	</style>
	<script type="text/javascript">
		var actflg="{:C('URL_MODEL')}"=="0"?"&":"?";
		function access_todo()
		{
			var selChk="";
			//遍历得到每个checkbox的value值
			$("input[name='chk_list[]']").each(function(){
				if(this.checked){selChk+=this.value+",";}				
			});
			selChk+="0";
			if(selChk=="0")
			{
				$.messager.show({title:'提示',msg:'没有选中要设置的项',timeout:5000,showType:'slide'});
			}
			else
			{
				$('#form1').submit();
			}
		}
		function selectall_todo()
		{
			$("input[name='chk_list[]']").attr("checked",true);
		}
		function selectall_undo()
		{
			$("input[name='chk_list[]']").attr("checked",false);
		}
	</script>
</head>
<body class="">
<form id="form1" method="post" action="{:U('Power/role_user_save')}">
	<div class="demo-info space-out-5px">
		<div class="demo-tip icon-tip"></div>
		<div>设置用户所属权限组  <b>({$role.name}-{$role.remark})</b><input type="hidden" id="role_id" name="role_id" value="{$role.id}" style="margin-top:6px;" /></div>
	</div>
	<div class=" space-out-10px">
	
	<div class="list-title">
		<div class="list-t-l w300px">选择用户：</div>
		<div class="list-t-r"></div>
	</div>
	<volist name="datalist" id="datalist">
	<div style="width:150px; float:left; margin:15px;">
		<div class="list-t-l"><input type="checkbox" name="chk_list[]" value="{$datalist.id}" <php>if(strpos($access,$datalist['id'])){echo 'checked';}</php> style="margin-top:6px;" /></div>
		<div class="list-t-l icon-usr" style="padding:0px 0px 0px 30px; height:25px; line-height:25px;">{$datalist.username}
		<img src="__PUBLIC__/Images/{$datalist.status_flg}.png" alt="{$datalist.status_flg}" title="{$datalist.status_flg}" /></div>
	</div>
	</volist>
	<div class="list-title">
		<div class="list-t-l">操作：<a href="javascript:;" onclick="selectall_todo()">全选</a> - <a href="javascript:;" onclick="selectall_undo()">取消选择</a>
		- <a href="javascript:;" class="easyui-linkbutton" iconCls="icon-save" onclick="access_todo()">保存</a>
		- <a href="{:U('Power/role_list')}" class="easyui-linkbutton" iconCls="icon-undo">取消</a>
		<div class="list-t-r"></div>
		</div>	
	</div>
</form>
</body>
</html>
